<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.js"></script>
</head>
<body>
<div id="app">
    <input type="text" v-model="question">
    <h3>{{answer}}</h3>
</div>
<script>
    new Vue({
        el: '#app',
        data: {
            question: '你好',
            answer: '我是answer',
        },
        watch: {
            //定义watch监听question的变化  当question发生改变时  会触发function
            question(){
                this.answer = "变了"
            }
        }
    })
</script>
</body>
</html>
